home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / l2101a.zip / CASTLE1.REF < prev    next >
Text File  |  1997-06-23  |  10KB  |  485 lines

  1. ;note to .ref masters:
  2. ;replace castle1 with something else to use this .ref for other dwellings
  3. ;this .ref uses no long term vars, instead it makes its own data file - this
  4. ;means upgrading the game will not make people 'lose ownership' of their
  5. ;stuff.
  6.  
  7. @#MYBANK
  8. ;team treasury
  9. @do moveback
  10. @do `p20 is 0
  11. @if tres1.dat exist true then do
  12.   @begin
  13.   @readfile tres1.dat
  14. `p20
  15.   @
  16.   @end
  17.  
  18. @clearblock 20 21
  19. @do move 3 21
  20. @do write
  21. `r0`2  Treasury is at `$$`p20`2 - (`0T`2)ake, (`0L`2)eave or (`0N`2)evermind? [`0N`2] :`%`x
  22. @do readspecial `s01 NTL
  23. @if `s01 is N then do
  24.  @begin
  25.  @do saybar
  26. You close the safe, carefully.
  27.  @closescript
  28.  @end
  29.  
  30. @if `s01 is T then do
  31.   @begin
  32.   @do move 5 23
  33.   @do write
  34. `0`r0Amount? `0: `%
  35.  @do readnum 10 0
  36.   @do `p21 is `v40
  37.   @if `p21 < 1 then `p21 is 0
  38.   @if `p21 > `p20 then do
  39.     @begin
  40.     @clearblock 21 24
  41.     @do saybar
  42. Not enough in here for that.
  43.     @closescript
  44.     @end
  45.  
  46.  @if `p21 is 0 then do
  47.    @begin
  48.     @clearblock 21 24
  49.     @do saybar
  50. You take nothing.
  51.     @closescript
  52.    @end
  53. //withdrawl.. we read from the file again so cheating won't be possible with
  54. //correct timing
  55.   @readfile tres1.dat
  56. `p20
  57.   @
  58.  
  59.   @if `p20 < `p21 then do
  60.     @begin
  61.     @clearblock 21 24
  62.     @do saybar
  63. Oh no!  Someone took the money while you were thinking about it!
  64.     @closescript
  65.     @end
  66.  
  67.     @do `p20 - `p21
  68.     @do money + `p21
  69.   @do delete tres1.dat
  70.   @writefile tres1.dat
  71. `p20
  72.   @
  73.     @clearblock 21 24
  74.     @do saybar
  75. `2You take `$`p21`2 from the treasury.
  76.  
  77. //if not owner, lets notify him
  78.  
  79. @readfile castle1.dat
  80. `p20
  81. `s01
  82. @
  83. ;load owner and current password
  84.  
  85. @if `p20 not &playernum then do
  86.   @begin
  87.    @writefile mail\mail`p20.dat
  88.   `0Runion Keep Reports:
  89. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90. `0  `n`2 has taken `$$`p21 `2from the treasury.
  91.  
  92.   @end
  93.   @closescript
  94.   @end
  95.  
  96. @if `s01 is L then do
  97.   @begin
  98.   @do move 5 23
  99.   @do write
  100. `0`r0Amount? `0: `%
  101.  @do readnum 10 &money
  102.   @do `p21 is `v40
  103.   @if `p21 < 1 then `p21 is 0
  104.   @if `p21 > money then do
  105.     @begin
  106.     @clearblock 21 24
  107.     @do saybar
  108. You are not carrying that much!
  109.     @closescript
  110.     @end
  111.  
  112.  @if `p21 is 0 then do
  113.    @begin
  114.     @clearblock 21 24
  115.     @do saybar
  116. You decide to leave nothing.  Ha!
  117.     @closescript
  118.    @end
  119.  
  120.   @do money - `p21
  121.  
  122. //deposit.. we read from the file again so cheating won't be possible with
  123. //correct timing
  124.   @readfile tres1.dat
  125. `p20
  126.   @
  127.   @do `p20 + `p21
  128.   @do delete tres1.dat
  129.   @writefile tres1.dat
  130. `p20
  131.   @
  132.     @clearblock 21 24
  133. //if not owner, lets notify him
  134.  
  135. @readfile castle1.dat
  136. `p20
  137. `s01
  138. @
  139. ;load owner and current password
  140.  
  141. @if `p20 not &playernum then do
  142.   @begin
  143.    @writefile mail\mail`p20.dat
  144.   `0Runion Keep Reports:
  145. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  146. `0  `n`2 has deposited `$$`p21 `2to the treasury.
  147.  
  148.   @end
  149.  
  150.  
  151.     @do saybar
  152. `2You leave `$`p21`2 in the treasury.
  153.   @closescript
  154.  
  155.  
  156.   @end
  157.  
  158.  
  159. @#TOWER
  160. ;Tower in the castle
  161. @DO SAYBAR
  162. `2The tower on this castle is not ready yet.
  163. @do moveback
  164.  
  165. @#doorguard
  166. @do moveback
  167. @label startg
  168. ;guy who owns on it pushes against the door guard symbol.  This lets him
  169. ;control the password to gain entrance to the castle, as well as sell it
  170. ;back or transfer ownership.
  171. @if castle1.dat exist false then do
  172.   @begin
  173.   @do saybar
  174. `0"You have 5 minutes to vacate this keep!" `2the guard barks.
  175.   @closescript
  176.   @end
  177.  
  178. @readfile castle1.dat
  179. `p20
  180. `s01
  181. @
  182. ;load owner and current password
  183.  
  184. @if `p20 not &playernum then do
  185.   @begin
  186.   @do saybar
  187. You wave to the door guard, nice of him to let you in.
  188.   @closescript
  189.   @end
  190. @busy
  191.  
  192.  
  193. @do `v01 is 1 ;set default choice to 1
  194. @show
  195. `r0`c  `r1 Instructing your servants `r0
  196.  
  197.   `2The huge doorguard snaps to attention when he sees you are going to
  198.   address him.
  199.  
  200. @do write
  201. `x`x
  202. @choice
  203. Set password to gain entrance (currently is `0`s01`%)
  204. Ownership options
  205. Leave
  206. @
  207. @if responce is 2 then do
  208.  @begin
  209.  @show
  210. `r0`c  `r1 Ownership Options `r0
  211.  
  212.   `2You retrieve your deed and carefully look it over.
  213.    
  214.    @do `v01 is 1
  215.    @do write
  216. `x`x
  217.    @choice
  218. Transfer deed to someone else
  219. Sell property back to the bank for `$1,500`%.
  220. Do nothing of the sort
  221.  @if response is 1 then do
  222.    @begin
  223.    @show
  224. `\`\  `2Transfer to whom?
  225.    @chooseplayer `p20
  226.  
  227.    @if `p20 is 0 then do
  228.     @begin
  229.     @show
  230.   `2You decide to keep your domain - for now.`\`\`k
  231.     @do goto startg
  232.     @end
  233.    @do `s02 is getname `p20
  234.    @show
  235. `2  Are you sure you wish to give your keep to `0`s02`2?
  236. @do write
  237. `x`x
  238. @choice
  239. Yes
  240. Not on your life.
  241.  @if responce is 2 then do
  242.    @begin
  243.     @show
  244. `\`\  `2You decide to keep your domain - for now.`\`\`k
  245.     @do goto startg
  246.    @end
  247.  
  248.   @do delete castle1.dat
  249.   @writefile castle1.dat
  250. `p20
  251. `s01
  252.    @writefile mail\mail`p20.dat
  253.   `0Business note:
  254. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  255. `0  `n`2 has transferred ownership of Runion Keep to you. 
  256.   Password to enter will remain `0"`s01"`2 unless
  257.   `2you come by and change it.
  258.  
  259.     @do addlog
  260.   `0`n`2 has given `%Runion Keep`2 to `0`s02`2!
  261.      @routine seperate in gametxt.ref
  262.  
  263.     @show
  264. `\`\  `2Deed transfered.  Oh well - it was fun while it lasted.`\`\`k
  265.    @do goto done
  266.    @end
  267.   @if response is 2 then do
  268.     @begin
  269.     @show
  270. `\`\`2  Are you sure you wish to sell your keep back to the bank?`\
  271. @do `v01 is 1
  272. @do write
  273. `x`x
  274. @choice
  275. Yes
  276. Not on your life.
  277.  @if responce is 2 then do
  278.    @begin
  279.     @show
  280. `\`\  `2You decide to keep your domain - for now.`\`\`k
  281.     @do goto startg
  282.    @end
  283.  
  284.   @do delete castle1.dat
  285.   @do money + 1500
  286.   @show
  287. `\`\  `%KEEP SOLD!`2`\`\`k
  288.     @do addlog
  289.   `0`n`2 has sold `%Runion Keep`2 back to the bank!
  290.     @routine seperate in gametxt.ref
  291.     @do goto done
  292.     @end
  293.  
  294.  
  295.   @do goto startg
  296.  @end
  297.  
  298. @if responce is 1 then do
  299.   @begin
  300.   @do write
  301. `\`\  `0"And the new password, s&sir?" `2(enter `4NONE`2 for no access to anyone)`\  `2Password:`x
  302.   @do readstring 40 `s01 `s01 
  303.   @do `p20 is length `s01
  304.   @if `p20 < 2 then do
  305.    @begin
  306.    @show
  307. `\`\  `2You decide the current password is ok.`\`\`k
  308.    @do goto startg
  309.    @end
  310.   @do delete castle1.dat
  311.   @writefile castle1.dat
  312. &playernum
  313. `s01
  314. @show
  315. `\`\  `0"Yes s&sir, I will not forget it!" `2the guard promises.`\`\`k
  316.    @do goto startg
  317.   @end
  318.  
  319. @drawmap
  320. @update
  321.  
  322. @#sign
  323. @do moveback
  324.  
  325.  @if castle1.dat exist false then do
  326.  @begin
  327.  @do saybar
  328. Runion Keep - For sale cheap, enquire inside.
  329.  @end 
  330.  
  331. @if castle1.dat exist true then do
  332.  @begin
  333. @readfile castle1.dat
  334. `p20
  335. `s01
  336. @
  337. @do `s01 is getname `p20
  338.  @do saybar
  339. `2Property of `0`s01`2.
  340.  @end 
  341.  
  342. @#enter
  343. @do moveback
  344. @offmap
  345. @if castle1.dat exist false then do
  346.   @begin
  347.   @show
  348. `r0`c  `r1 `%For Sale `r0
  349.  
  350.   `2Runion Keep was once a magnificient structure that housed many of
  351.   the royal families.  Now it houses dust and decay.
  352.  
  353.   It is for sale, however.  The asking price is `$$3,000`2.
  354.  
  355. @do `v01 is 1
  356. @do write
  357. `x`x
  358. @choice
  359. >&money 2999 Purchase it.
  360. <&money 3000 Sigh wistfully and leave since you don't have enough.
  361. >&money 2999 Leave.
  362. @
  363.  
  364. @if responce is 1 then do
  365.   @begin
  366.   @if castle1.dat exist true then do
  367.     @begin
  368.     @show
  369. `\`\  `2Oh crap!  Someone bought it while you were thinking about it.  You
  370.   will regret your snail like thinking for the rest of your days.`\`\`k
  371.     @do goto done
  372.     @end
  373.  
  374.   @writefile castle1.dat
  375. &playernum
  376. NONE
  377.     @do money - 3000
  378.     @do addlog
  379.   `0`n `2buys `%Runion Keep`2!
  380.      @routine seperate in gametxt.ref
  381.  
  382.   @show
  383. `r0`c  `r1 `%Why hello there, landowner! `r0
  384. `\`2  Nice job!  You now own this keep!
  385.  
  386. `k  `0As a special bonus, two beds and a door guard are included!
  387.  
  388.   `2Enjoy your new home.`\`\`k
  389.   @end
  390.  
  391. @label done
  392. @drawmap
  393. @update
  394. @closescript
  395.   @end
  396.  
  397. @readfile castle1.dat
  398. `p20
  399. `s01
  400. @
  401.  
  402. @do `p21 is deleted `p20
  403.  
  404. @if `p21 is 1 then do
  405.   @begin
  406.    ;owner got deleted!!!  Lets put it up for sale again.
  407.    @do delete castle1.dat
  408.     @do addlog
  409.   `%Runion Keep`2 is put on the market today.
  410.      @routine seperate in gametxt.ref
  411.  
  412.    ;run script again
  413.    @do goto enter
  414.   @end
  415.  
  416. @if `p20 not &playernum then do
  417.   @begin
  418.   @do `s02 is getname `p20
  419.   @do upcase `s01
  420.   @if `s01 is NONE then do
  421.    @begin
  422.    @show
  423. `r0`c  `r1 None shall pass `r0
  424.  
  425.   `2You pound on the door for some time before you get an answer.
  426.  
  427.   `0"Master `s02`0 has declared that `4NO`0 visitors shall be allowed!" `2a
  428.   voice calls from behind the wall.
  429.  
  430.   `4Ouch!
  431.  
  432. `k
  433.    @do goto done
  434.    @end
  435.  
  436.   @show
  437. `r0`c  `r1 Stand and unfold thyself `r0
  438.  
  439. `2  A head pops over the gate.  `0"Halt, you!  What business have you with
  440.   my lord and master, `%`s02`0?" `2the door guard asks.
  441.  
  442. @do write
  443. `x`x
  444. @do `v01 is 1
  445. @choice
  446. Offer an explanation.
  447. Visit later.
  448.   @if response is 1 then do
  449.    @begin
  450.    @do write
  451. `\`\  `2Say what? :`x
  452.   @do readstring 40 NIL `s03 
  453.   @do upcase `s03
  454.   @do upcase `s01
  455.  
  456.   @if `s03 is `s01 then do
  457.     @begin
  458.     @show
  459. `\`\  `0"Welcome to `%Runion Keep`0,"`2 the guard smiles as he opens the gate.`\`\`k
  460.     @do goto letmein
  461.     @end
  462.    @writefile mail\mail`p20.dat
  463.   `0Runion Keep Reports:
  464. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  465. `0  `n`2 attempted to sweet talk the guard by saying
  466.   `0"`s03"`2.  `2He was `bNOT`2 allowed in.
  467.  
  468.    @show
  469. `\`\  `2The guard doesn't look too interested.`\`\`k
  470.    @do goto done
  471.    @end
  472.  
  473.   @do goto done
  474.  
  475.   @end
  476.  
  477. ;let him in
  478. @label letmein
  479. @do x is 39
  480. @do y is 19
  481. @do map is 1361
  482. @loadmap 1361
  483. @do goto done
  484. @#done
  485.